package os.t2;

import java.util.concurrent.Semaphore;

public class Resources {
    public int[] res=new int[2];//缓冲区，临界资源2个
    public int count=0;//数组的下标
    public Semaphore rMutex=new Semaphore(1);//读者锁
    public Semaphore wMutex=new Semaphore(1);//写者锁
    public int readCount=0;//用于读者计数，读者也是临界资源



}
